define(function (repire, exports, module) {
	'use strict';
    var editUtil = {};
    editUtil = $.extend(editUtil, require('./editUtil_default'));
    
    (function (){ 

        var me = editUtil = {
            create: function(el, type, opt){//给定任意div或span，在其中生成编辑控件
                var me = this;
                el.attr('editor-type', type);
                me['create'+type](opt);
            },
            setValue: function(el, value){//给定div中的编辑控件赋值
                var me = this;
                var type = el.attr('editor-type');
                me['setValue'+type](opt);
            },
            getValue: function(el, value){//获取指定div中的值
                var me = this;
                var type = el.attr('editor-type');
                me['getValue'+type](opt);
            },
            getFormatText: function(type, value){
                var me = this;
                var type = el.attr('editor-type');
                me['getFormatText'+type](value);
            },
            validate: function(container, value){//校验，*需讨论如何扩展校验规则
                var me = this;
                var ok = true;
                container.find('[editor-type]').each(function(){
                    var el = $(this);
                    var value = me.getValue(this);
                    if(!value) ok = false;
                });
                return ok;
            },
            destroy: function(){
                var me = this;
                var type = el.attr('editor-type');
                me['destroy'+type]();
            }
        };

        exports = editUtil;
    })();

    return editUtil;
});